<blockquote class="layui-elem-quote">登录密码不填写,则表示不修改登录密码.</blockquote>
<form class="layui-form">
  <div class="layui-form-item">
    <label class="layui-form-label">登录账户</label>
    <div class="layui-input-block">
      <input type="text" disabled placeholder="请输入登录账户" value="<{$info['username']}>" autocomplete="off" class="layui-input">
    </div>
  </div>
  <div class="layui-form-item">
    <label class="layui-form-label">真实姓名</label>
    <div class="layui-input-block">
      <input type="text" name="name" placeholder="请输入真实姓名"  value="<{$info['name']}>" autocomplete="off" class="layui-input">
    </div>
  </div>
  <div class="layui-form-item">
    <label class="layui-form-label">联系电话</label>
    <div class="layui-input-block">
      <input type="text" name="phone" placeholder="请输入联系电话"  value="<{$info['phone']}>" autocomplete="off" class="layui-input">
    </div>
  </div>
  <div class="layui-form-item">
    <label class="layui-form-label">登录密码</label>
    <div class="layui-input-block">
      <input type="text" name="pwd" placeholder="请输入登录密码" autocomplete="off" class="layui-input">
    </div>
  </div>
  <div class="layui-form-item">
    <label class="layui-form-label">上传头像</label>
    <div class="layui-input-block">
      <input type="hidden" name="avatar" value="<{$info['avatar']}>" />
      <div class="layui-upload ">
        <button type="button" class="layui-btn myupload">上传图片</button>
        <div class="layui-upload-list">
          <img style="width:92px;height:92px;margin:0 10px 10px 0;" src="<{:pic($info['avatar'])}>" id="avatarimg">
          <p id="avatartxt" style="color:red"></p>
        </div>
      </div>
    </div>
  </div>
  <div class="layui-form-item">
    <div class="layui-input-block">
      <button class="layui-btn" id="btn" lay-submit="" lay-filter="form">立即提交</button>
    </div>
  </div>
</form>
<script>
$().ready(function(){
  //拖拽上传
  layui.upload.render({
    url:'/api/upimg',
    elem: '.myupload',
    accept:'images',
    //size:100,
    //auto:false,
    before:function(obj){
      layer.load(1, {shade: [0.1,'#fff']});
    },
    //bindAction:'#btn',
    choose: function(obj){
        obj.preview(function(index, file, result){
          $('#avatarimg').attr('src', result);
        });
    },
    done:function(rs,index,upload){
        layer.closeAll('loading');
        if(rs.code){
          $("#avatartxt").text(rs.msg);
        }else{
          $("#avatarimg").attr('src',rs.data.src)
          $("[name='avatar']").val(rs.data.src);
        }
    },
    error:function(index,upload){
        layer.closeAll('loading');
    }
  });
});
</script>
